<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('meeting/hire/lists')}">场地验收</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('meeting/hire/lists')}">
        服务名称：
        <input class="form-control" type="text" name="number" style="width: 200px;" value="{:input('request.number')}"
               placeholder="">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('meeting/hire/lists')}">清空</a>
    </form>
    <form method="post" class="js-ajax-form">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th>id</th>
                <th>展位编号</th>
                <th>搭建商</th>
                <th>时间</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <php>
                $status = [
                0=>'待审核',
                1=>'已通过',
                2=>'已拒绝',
                ];
            </php>
            <tbody>
            <foreach name="list" item="vo">
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.number}</td>
                    <td>{$vo.builder_name}</td>
                    <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
                    <td>{$status[$vo['status']]}</td>
                    <td>
                        <a onclick="check({$vo['id']},'{$vo['number']}',{$vo['status']},'{$vo['remark']}')" class="btn btn-success">审核</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
    </form>
    <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h5 class="modal-title" id="myModalLabel" style="font-size: 16px;">审核</h5>
                </div>
                <form action="{:url('check')}" method="post" class="form js-ajax-form" >
                    <div class="modal-body">
                        <div class="form-group">
                            <label for="number">编号</label>
                            <input class="form-control" type="text" id="number" disabled value="">
                            <input type="hidden" id="id" name="id" value="">

                        </div>

                        <div class="form-group">
                            <input type="radio" id="status_1" name="status" value="1">同意
                            <input type="radio" id="status_2" name="status" value="2">拒绝

                        </div>
                        <div class="form-group">
                            <label for="reason">理由</label>
                            <textarea name="remark" id="remark" class="form-control" rows="10"></textarea>
                        </div>

                    </div>
                    <div class="modal-footer">
                        <button type="submit" id="submit" class="btn btn-success js-ajax-submit">提交</button>
                    </div>
                    <div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;">
                        <div style="width: 100%;height: 50px;background-color: white;font-size: .8cm;padding-top: 10px;" align="center">
                            查看图片
                        </div>
                        <div id="innerdiv" style="position:absolute;">
                            <img id="bigimg" style="border:5px solid #fff;" src="" />
                        </div>
                    </div>
                </form>

            </div>
        </div>
    </div>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    function check(id,number,status,remark) {
        $('#myModal2').modal('show')
        $('#id').val(id)
        $('#number').val(number)

        if(status === 1){
            $('#status_1').attr({checked:'checked'})
            $('#submit').css({display:'none'})
        }
        if(status === 2){
            $('#status_2').attr({checked:'checked'})
        }
        $('#remark').text(remark)

    }
</script>
</body>
</html>